<?php

/**
 * This is the model class for table "jumlahkonsumenairminum".
 *
 * The followings are the available columns in table 'jumlahkonsumenairminum':
 * @property integer $jkam_id
 * @property integer $jkam_tahun
 * @property double $jkam_rumah
 * @property double $jkam_pemerintah
 * @property double $jkam_niaga
 * @property double $jkam_sosial
 * @property double $jkam_kran_umum
 * @property double $jkam_industri
 */
class Jumlahkonsumenairminum extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Jumlahkonsumenairminum the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'jumlahkonsumenairminum';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('jkam_tahun', 'numerical', 'integerOnly'=>true),
			array('jkam_rumah, jkam_pemerintah, jkam_niaga, jkam_sosial, jkam_kran_umum, jkam_industri', 'numerical'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('jkam_id, jkam_tahun, jkam_rumah, jkam_pemerintah, jkam_niaga, jkam_sosial, jkam_kran_umum, jkam_industri', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'jkam_id' => 'Jkam',
			'jkam_tahun' => 'Tahun',
			'jkam_rumah' => 'Rumah Tangga/Non Niaga',
			'jkam_pemerintah' => 'Pemerintah dan Hankam',
			'jkam_niaga' => 'Niaga',
			'jkam_sosial' => 'Sosial',
			'jkam_kran_umum' => 'Kran Umum',
			'jkam_industri' => 'Industri',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('jkam_id',$this->jkam_id);
		$criteria->compare('jkam_tahun',$this->jkam_tahun);
		$criteria->compare('jkam_rumah',$this->jkam_rumah);
		$criteria->compare('jkam_pemerintah',$this->jkam_pemerintah);
		$criteria->compare('jkam_niaga',$this->jkam_niaga);
		$criteria->compare('jkam_sosial',$this->jkam_sosial);
		$criteria->compare('jkam_kran_umum',$this->jkam_kran_umum);
		$criteria->compare('jkam_industri',$this->jkam_industri);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}